package com.mashangwan.paleto.mapper;

import com.mashangwan.paleto.domain.RoleMenuExample;
import com.mashangwan.paleto.domain.RoleMenuKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface RoleMenuMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role_menu
     *
     * @mbggenerated Sun Jan 14 22:52:52 CST 2018
     */
    @SelectProvider(type=RoleMenuSqlProvider.class, method="countByExample")
    int countByExample(RoleMenuExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role_menu
     *
     * @mbggenerated Sun Jan 14 22:52:52 CST 2018
     */
    @DeleteProvider(type=RoleMenuSqlProvider.class, method="deleteByExample")
    int deleteByExample(RoleMenuExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role_menu
     *
     * @mbggenerated Sun Jan 14 22:52:52 CST 2018
     */
    @Delete({
        "delete from sys_role_menu",
        "where role_id = #{roleId,jdbcType=BIGINT}",
          "and menu_id = #{menuId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(RoleMenuKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role_menu
     *
     * @mbggenerated Sun Jan 14 22:52:52 CST 2018
     */
    @Insert({
        "insert into sys_role_menu (role_id, menu_id)",
        "values (#{roleId,jdbcType=BIGINT}, #{menuId,jdbcType=BIGINT})"
    })
    int insert(RoleMenuKey record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role_menu
     *
     * @mbggenerated Sun Jan 14 22:52:52 CST 2018
     */
    @InsertProvider(type=RoleMenuSqlProvider.class, method="insertSelective")
    int insertSelective(RoleMenuKey record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role_menu
     *
     * @mbggenerated Sun Jan 14 22:52:52 CST 2018
     */
    @SelectProvider(type=RoleMenuSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="menu_id", property="menuId", jdbcType=JdbcType.BIGINT, id=true)
    })
    List<RoleMenuKey> selectByExampleWithRowbounds(RoleMenuExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role_menu
     *
     * @mbggenerated Sun Jan 14 22:52:52 CST 2018
     */
    @SelectProvider(type=RoleMenuSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="menu_id", property="menuId", jdbcType=JdbcType.BIGINT, id=true)
    })
    List<RoleMenuKey> selectByExample(RoleMenuExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role_menu
     *
     * @mbggenerated Sun Jan 14 22:52:52 CST 2018
     */
    @UpdateProvider(type=RoleMenuSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") RoleMenuKey record, @Param("example") RoleMenuExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table sys_role_menu
     *
     * @mbggenerated Sun Jan 14 22:52:52 CST 2018
     */
    @UpdateProvider(type=RoleMenuSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") RoleMenuKey record, @Param("example") RoleMenuExample example);
}